#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：henan_sumo
@File ：处理点位信息.py
@IDE ：PyCharm
@Author ：xinyingjie
@Date ：2025/5/24 12:18
'''
RADAR_DATA_LIST = {
    1: {'sn': 1, 'lon': 116.4310726, 'lat': 39.73943829, 'Downstream': {'sn': 35},
        'Upstream': None,
        'disDown': 2393, 'normal': True},
    2: {'sn': 2, 'lon': 116.4280638, 'lat': 39.75005531, 'Downstream': {'sn': 37},
        'Upstream': {'sn': 33},
        'disDown': 1145, 'normal': True},
    3: {'sn': 3, 'lon': 116.4256975, 'lat': 39.75950848, 'Downstream': {'sn': 17},
        'Upstream': {'sn': 35},
        'disDown': 363, 'normal': True},
    4: {'sn': 4, 'lon': 116.4244934, 'lat': 39.7685285, 'Downstream': {'sn': 19},
        'Upstream': {'sn': 37},
        'disDown': 593, 'normal': True},
    5: {'sn': 5, 'lon': 116.4254769, 'lat': 39.7616087, 'Downstream': {'sn': 21},
        'Upstream': {'sn': 17},
        'disDown': 596, 'normal': True},
    6: {'sn': 6, 'lon': 116.4299701, 'lat': 39.7434342, 'Downstream': {'sn': 23},
        'Upstream': {'sn': 19},
        'disDown': 324, 'normal': True},
    7: {'sn': 23, 'lon': 113.804028033, 'lat': 34.516033499, 'Downstream': {'sn': 25},
        'Upstream': {'sn': 21},
        'disDown': 777, 'normal': True},
    8: {'sn': 25, 'lon': 113.802948288, 'lat': 34.509094823, 'Downstream': {'sn': 27},
        'Upstream': {'sn': 23},
        'disDown': 578, 'normal': True},
    9: {'sn': 27, 'lon': 113.803285954, 'lat': 34.503899314, 'Downstream': {'sn': 29},
        'Upstream': {'sn': 25},
        'disDown': 677, 'normal': True},
    10: {'sn': 29, 'lon': 113.803775624, 'lat': 34.497822559, 'Downstream': {'sn': 31},
         'Upstream': {'sn': 27},
         'disDown': 1018, 'normal': True},
    11: {'sn': 29, 'lon': 113.803775624, 'lat': 34.497822559, 'Downstream': {'sn': 31},
         'Upstream': {'sn': 27},
         'disDown': 1018, 'normal': True},
    12: {'sn': 29, 'lon': 113.803775624, 'lat': 34.497822559, 'Downstream': {'sn': 31},
         'Upstream': {'sn': 27},
         'disDown': 1018, 'normal': True},
    13: {'sn': 29, 'lon': 113.803775624, 'lat': 34.497822559, 'Downstream': {'sn': 31},
         'Upstream': {'sn': 27},
         'disDown': 1018, 'normal': True},
    14: {'sn': 29, 'lon': 113.803775624, 'lat': 34.497822559, 'Downstream': {'sn': 31},
         'Upstream': {'sn': 27},
         'disDown': 1018, 'normal': True},
    15: {'sn': 29, 'lon': 113.803775624, 'lat': 34.497822559, 'Downstream': {'sn': 31},
         'Upstream': {'sn': 27},
         'disDown': 1018, 'normal': True},
    16: {'sn': 29, 'lon': 113.803775624, 'lat': 34.497822559, 'Downstream': {'sn': 31},
         'Upstream': {'sn': 27},
         'disDown': 1018, 'normal': True},

}

info = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 1
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4310726,
                    39.73943829
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 2
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4280638,
                    39.75005531
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 3
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4256975,
                    39.75950848
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 4
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4244934,
                    39.7685285
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 5
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4254769,
                    39.7616087
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 6
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4299701,
                    39.7434342
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 7
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4239826,
                    39.77116232
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 8
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4240484,
                    39.77798255
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 9
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4236011,
                    39.77833934
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 10
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4233678,
                    39.77179096
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 11
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.42371,
                    39.76847134
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 12
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4247321,
                    39.76152304
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 13
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4290889,
                    39.74394431
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 14
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4261857,
                    39.75540889
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 15
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4285662,
                    39.7464115
                ]
            }
        },
        {
            "type": "Feature",
            "properties": {
                "marker-color": "#7e7e7e",
                "marker-size": "medium",
                "marker-symbol": "",
                "sn": 16
            },
            "geometry": {
                "type": "Point",
                "coordinates": [
                    116.4306522,
                    39.73931893
                ]
            }
        },

    ]
}

features = info['features']
for feature in features:
    sn = feature['properties']['sn']
    lon = feature['geometry']['coordinates'][0]
    lat = feature['geometry']['coordinates'][1]
    RADAR_DATA_LIST[sn]['sn'] = sn
    RADAR_DATA_LIST[sn]['lon'] = lon
    RADAR_DATA_LIST[sn]['lat'] = lat
print(RADAR_DATA_LIST)